package com.testfileupload.uploadimg.design.intermediary.normal;

public class Purcchase {
    //采购电脑
    public void buyIBMComputer(int num){
        //访问库存
        Stock stock = new Stock();
        //访问销售
        Sale sale = new Sale();
        //电脑销售情况
        int saleStatus = sale.getSaleStatus();
        if (saleStatus>80){//销售数量好
            System.out.println("采购数量为"+num);
            stock.increase(num);
        }else {//销售数量不好
            int num2 = num/2;
            System.out.println("采购数量折半为"+num2);
            stock.increase(num2);
        }

    }
    //不再采购
    public void refuseBuyIBM(){
        System.out.println("不采购IBM");
    }
}
